package game;

import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;

public class SkinnedPlatform extends Platform {
	public static final long serialVersionUID = 1L;
	protected ImageIcon icon;
	
	public SkinnedPlatform(){
	}
	
	public SkinnedPlatform(Level g, int x, int y, int w, int h, BufferedImage i){
		super(g, x, y, i.getWidth(), i.getHeight(), Color.pink);
		icon = new ImageIcon(i);
		width = h;
		height = h;
	}
	
	@Override
	public void draw(){
		if(icon != null){
			level.canvas.bufGraphics.drawImage(icon.getImage(), x-level.canvas.currentX, y-level.canvas.currentY, width, height, level.canvas);
		}else{
			level.canvas.bufGraphics.setColor(Color.pink);
			level.canvas.bufGraphics.fillRect(x-level.canvas.currentX, y-level.canvas.currentY, width, height);
		}
	}
}
